package com.dandan.tzx.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.dandan.tzx.App;
import com.dandan.tzx.routerhelper.R;

/**
 * Created by tanzhenxing
 * Date: 2017/12/22 下午2:55
 * Description:
 */

@Route(path = Example1Activity.PATH, group = "activity", extras = 10)
public class Example1Activity extends BaseActivity {
    public static final String PATH = "/Example1Activity";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_example1);
        init();
    }

    protected void init() {
        setTitle(TAG);
        textView = (TextView) findViewById(R.id.text_view);
        textView.setText(this.getClass().getSimpleName());
        button = (Button) findViewById(R.id.button);
        button.setText("Application");
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //DDRouter.getInstance().build(MainActivity.PATH).navigation();
                //DDRouter.getInstance().build(ParamsCallActivity.PATH).navigation();
                Intent intent = new Intent(App.getApp(), ParamsCallActivity.class);
                Log.d("tanzhenxing", "onClick: flag = " + intent.getFlags());
                App.getApp().startActivity(intent);

            }
        });
    }
}
